<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('修改用户')"/>
    <th:block th:include="include :: datetimepicker-css"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-user-edit" th:object="${miniuser}">
        <input name="id" th:field="*{id}" type="hidden">
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户名称
                ：</label>
            <div class="col-sm-8">
                <input name="username" th:field="*{username}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户密码
                ：</label>
            <div class="col-sm-8">
                <input name="password" th:field="*{password}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">性别：0 未知， 1男， 1 女
                ：</label>
            <div class="col-sm-8">
                <input name="gender" th:field="*{gender}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">生日
                ：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="birthday"
                           th:value="${#dates.format(miniuser.birthday, 'yyyy-MM-dd')}"
                           class="form-control" placeholder="yyyy-MM-dd"
                           type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">最近一次登录时间
                ：</label>
            <div class="col-sm-8">
                <div class="input-group date">
                    <input name="lastLoginTime"
                           th:value="${#dates.format(miniuser.lastLoginTime, 'yyyy-MM-dd')}"
                           class="form-control" placeholder="yyyy-MM-dd"
                           type="text">
                    <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                </div>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">最近一次登录IP地址
                ：</label>
            <div class="col-sm-8">
                <input name="lastLoginIp" th:field="*{lastLoginIp}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">用户层级 0 普通用户，1 VIP用户，2 区域代理用户
                ：</label>
            <div class="col-sm-8">
                <input name="userLevel" th:field="*{userLevel}" class="form-control"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户昵称或网络名称
                ：</label>
            <div class="col-sm-8">
                <input name="nickname" th:field="*{nickname}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户手机号码
                ：</label>
            <div class="col-sm-8">
                <input name="mobile" th:field="*{mobile}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">用户头像图片
                ：</label>
            <div class="col-sm-8">
                <input name="avatar" th:field="*{avatar}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label is-required">微信登录openid
                ：</label>
            <div class="col-sm-8">
                <input name="weixinOpenid" th:field="*{weixinOpenid}" class="form-control"
                       type="text" required>
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">状态
                ：</label>
            <div class="col-sm-8">
                <input name="deleted" th:field="*{deleted}" class="form-control"
                       type="text">
            </div>
        </div>
        <div class="form-group">
            <label class="col-sm-3 control-label">分享用户id
                ：</label>
            <div class="col-sm-8">
                <input name="shareUserId" th:field="*{shareUserId}" class="form-control"
                       type="text">
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<th:block th:include="include :: datetimepicker-js"/>
<script th:inline="javascript">
        var prefix = ctx + "mini/user";
        $("#form-user-edit").validate({
            focusCleanup: true
        });

        function submitHandler() {
            if ($.validate.form()) {
                $.operate.save(prefix + "/edit", $('#form-user-edit').serialize());
            }
        }

        $("input[name='birthday']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });

        $("input[name='lastLoginTime']").datetimepicker({
            format: "yyyy-mm-dd",
            minView: "month",
            autoclose: true
        });


</script>
</body>
</html>